<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/common/jsp/taglibs-nojs-nocss.jsp"%>
<%@ page isELIgnored="false" %>
<%
	String path_part = request.getContextPath();
	String basePathter = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path_part + "/";
%>
<div class="wbs_scroll" style="height:23px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="gridview">
	<thead>
	   <tr class="title">
           <td style="width:10%;">序号</td>
           <td style="width:15%;">考核题目</td>
           <td style="width:15%;">创建考核时间</td>
           <td style="width:10%;">考核类型</td>
           <td style="width:10%;">备注</td>
           <td style="width:10%;">发起人</td>
           <td style="width:30%;">操作</td>
       </tr>
	</thead>
</table>
</div>
<div class="wbs_scroll" style="height:396px;" >
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="gridview" id="sale_saleChance_table">
	<tbody class="mytbody">
		<s:if test="listExamineManager.size()==0">
       		<tr>
       			<td colspan="2" align="center">无记录</td>
       		</tr>
       	</s:if>
       	<s:else>
         <s:iterator value="listExamineManager" status="stat">
          <tr>
              <td style="width:10%;"><s:property value="#stat.count"/></td>
              <td style="width:15%;"><s:property value="name"/></td>
              <td style="width:15%;"><s:property value="thisDate"/></td>
              <td style="width:10%;"><s:property value="type"/></td>
              <td style="width:10%;"><s:property value="memo"/></td>
              <td style="width:10%;"><s:property value="user.cname"/></td>
              <td style="width:30%;">
              	 <s:if test="status==1">
              		<a href="<%=basePathter %>examine/startExamine?examineManageVo.id=<s:property value="id" />">开始考核 | </a>
              		<si:role url="/examine/endExamine.action">
              			<a href="<%=basePathter %>examine/endExamine?examineManageVo.id=<s:property value="id" />"> 结束考核</a>
              		</si:role>
              	</s:if>
              	<s:else>
              		本次考核已结束 
              		 <si:role url="/examine/showAllExamine.action">
              		 	| <a href="<%=basePathter %>examine/showExamine?examineManageVo.id=<s:property value="id" />">查看所有人员结果</a>
              		 </si:role>
              		 | <a href="<%=basePathter %>examine/showExamine?toUser.id=<s:property value="#session.user.userId" />&examineManageVo.id=<s:property value="id" />">查看我的考核结果</a>
              	</s:else>
              		<si:role url="/examine/deleteExamineAndManager.action">
              			| <a href="javascript:void(0)" onclick="removeTr('<s:property value="id" />');">删除</a>
              		</si:role>
              </td>
          </tr>
         </s:iterator>
       	</s:else>
	</tbody>
</table>
<%@include file="../../../common/jsp/pageing.jsp" %>
</div>
<script>
		function removeTr(id){
			if(window.confirm("您确定删除此考核吗？")){
				var _url = '<%=basePathter %>examine/deleteExamineAndManager?examineManageVo.id='+id;
				$.ajax( {
					url : _url,
					type : 'POST',
					success : function(result){
						// 通过javascript对象把返回的结果转为javascript对象
						var jsonMsgObj=new JsonMsgObj(result);
						// 通过getMessage()得到返回的异常信息,此异常信息为json格式
						var  msg=jsonMsgObj.getMessage();
						// 如果为-1就是验证异常
						var codeId=jsonMsgObj.getCodeid();
						var isOk=jsonMsgObj.getIsok();
						// 判断是否插入成功了
						if( isOk ){
							// 执行添加操作成功了，在页面要完成的操作
							// 在此时要完成的操作就是在父页面的科目列表中添加一行新插入的信息
							aerouiAlert(msg);
							hideDialog();
							window.location.reload();
						// 如果插入没有成功时
						}else{
							// 如果没有成功，就处理异常
							jsHandleException( codeId , msg );
						}
					}
				} );
			}
		}
        // 分页
		function gotoPage( pageNo , totalPage , pageSize ){
			// 按page的信息加载数据
			// 如果当前页大于了最大页数就弹出警告
			if( pageNo > totalPage ){
				window.alert( '总页数为'+totalPage+' , 请重新输入页码!' );
				return;
			}
			location.href = 'getAllExamineManage.action?page.pageNo='+pageNo+'&page.totalPage='+totalPage+'&page.pageSize='+pageSize+'';
		}
</script>